<?php
/**
 * 收益管理模块
 */
namespace Admin\Controller\Invest;
use Think\Controller;

class ProfitController extends Controller 
{
	/**
	 * 收益管理列表页
	 */
	public function profit_manage() 
	{
		$name = I("post.name","");
		$title = I("post.title","");
		$time = I("post.time","");
		$type = I("post.type","");

		$search_array['name'] = $name;
		$search_array['title'] = $title;
		$search_array['time'] = $time;
		$search_array['type'] = $type;
		$this->assign("search_array",$search_array);

		$profit = D("Profit");
		$profit_array = $profit->get_profit_list($name,$title,$time,$type);

		if ($range7 = I("post.time7","")) 
		{
			$profit_array = $profit->get_profit_list('','','','',$range7);
		}
		if ($range15 = I("post.time15","")) 
		{
			$profit_array = $profit->get_profit_list('','','','',$range15);
		}
		if ($range30 = I("post.time30","")) 
		{
			$profit_array = $profit->get_profit_list('','','','',$range30);
		}

		$json = json_encode($profit_array);
		$this->assign('profit_json',$json);

		$this->display();
	}
}